package com.woniu.config;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

@Component
public class SwaggerResourceConfig implements SwaggerResourcesProvider {
    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
                creat("消息服务","/message/v2/api-docs")
                , creat("订单服务","/order/v2/api-docs")
                , creat("权限服务","/permissions/v2/api-docs")
                , creat("积分商城服务","/pointsmall/v2/api-docs")
                , creat("员工服务","/staff/v2/api-docs")
                , creat("站点服务","/station/v2/api-docs")
                , creat("用户服务","/user/v2/api-docs")
                , creat("仓库服务","/depot/v2/api-docs")
                , creat("流程服务","/flow/v2/api-docs")
        );
    }

    private SwaggerResource creat(String name,String url){
        SwaggerResource sr = new SwaggerResource();
        sr.setLocation(url);
        sr.setName(name);
        return sr;
    }
}
